/* GUI CONVERTED from rcrssupa.p (converter v1.75) Thu Mar 15 07:09:57 2001 */
/* rcrssupa.p - Customer Schedules - Required Schedule Selective Update */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                  */
/* All rights reserved worldwide.  This is an unpublished work.         */
/* $Revision: 1.5.3.4 $                                                 */
/*V8:ConvertMode=Report                                                 */
/* REVISION: 7.4      LAST MODIFIED: 09/08/95   BY: bcm *G0TB*          */
/* REVISION: 8.6E     LAST MODIFIED: 02/23/98   BY: *L007* A. Rahane    */
/* REVISION: 8.6E     LAST MODIFIED: 05/20/98   BY: *K1Q4* Alfred Tan   */
/* REVISION: 8.6E     LAST MODIFIED: 10/04/98   BY: *J314* Alfred Tan   */
/* REVISION: 9.1      LAST MODIFIED: 08/20/99   BY: *N01B* Mugdha Tambe */
/* REVISION: 9.1      LAST MODIFIED: 05/20/99   BY: *N004* Patrick Rowan*/
/* REVISION: 9.1      LAST MODIFIED: 08/12/00   BY: *N0KP* myb          */
/* Old ECO marker removed, but no ECO header exists *F0PN*               */
/* $Revision: 1.5.3.4 $    BY: Katie Hilbert  DATE: 03/11/01 ECO: *N0XB*   */
/******************************************************************************/
/* All patch markers and commented out code have been removed from the source */
/* code below. For all future modifications to this file, any code which is   */
/* no longer required should be deleted and no in-line patch markers should   */
/* be added.  The ECO marker should only be included in the Revision History. */
/******************************************************************************/
/* REQUIRED SCHEDULE SELECTIVE UPDATE - SUB PROGRAM */


/*GUI preprocessor directive settings */
&SCOPED-DEFINE PP_GUI_CONVERT_MODE REPORT

{mfdeclre.i}
{gplabel.i}

/* ********** Begin Translatable Strings Definitions ********* */

&SCOPED-DEFINE rcrssupa_p_2 "Ship Schedule Release ID"
/* MaxLen: Comment: */

&SCOPED-DEFINE rcrssupa_p_3 "Report"
/* MaxLen: Comment: */

&SCOPED-DEFINE rcrssupa_p_4 "Plan Schedule Release ID"
/* MaxLen: Comment: */

/* ********** End Translatable Strings Definitions ********* */

&SCOPED-DEFINE simulation true
/* PREPROCESSOR USED FOR REPORT'S WITH SIMULATION OPTION */

define input parameter     scx_recid      as recid no-undo.
define input parameter     seq_rlse_id    like rcs_rlse_id.
define input parameter     ship_rlse_id   like sch_rlse_id label
   {&rcrssupa_p_2}.
define input parameter     plan_rlse_id   like sch_rlse_id label
   {&rcrssupa_p_4}.

define     shared variable report_yn      like mfc_logical
   label {&rcrssupa_p_3} initial yes.
/* DEFAULT VALUE FOR UPDATE_YN IS CHANGED FROM YES TO NO */
/* SINCE IT IS RECOMMENDED APPROACH IN HELP DOCUMENTATION */
define     shared variable update_yn      like mfc_logical no-undo.
define     shared variable global_schtype as integer.
define     shared stream   audit.
define     shared variable audit_yn       like mfc_logical.
define     shared variable warn_ct        as integer no-undo.
define     shared variable week_offset    as integer.

do on error undo, retry:

   find scx_ref where recid(scx_ref) = scx_recid no-lock.
   find so_mstr where so_nbr   = scx_order no-lock no-error.
   find si_mstr where si_site  = scx_shipfrom no-lock no-error.
   find sod_det where sod_nbr  = scx_order and
      sod_line = scx_line  no-lock no-error.

   {mfphead2.i}

   /* IF NOT CONNECTED, ISSUE ERROR AND UNDO */
   if si_db <> global_db
      and not connected(si_db) then do:
      {mfmsg03.i 2510 4 "si_db" """" """"}
      /* DATABASE NOT CONNECTED */
      pause 2.
   end.
   else do:

      week_offset = integer(substring(so_conrep,1,1)).

      /* ADDED seq_rlse_id FOR SEQUENCE SCHEDULE PROCESSING */
      {gprun.i ""rcrsupb.p""
         "(input sod_nbr, sod_line, plan_rlse_id,
           ship_rlse_id, seq_rlse_id)"}

   end.
end.
